<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <base href="<%= basePath %>"/>
    <title>Insert title here</title>
    <style>
        body {
            background: #f5f6fa;
            font-family: 'Segoe UI', 'Arial', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .register-container {
            background: #fff;
            padding: 32px 40px;
            border-radius: 12px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.08);
            min-width: 320px;
        }
        h1 {
            text-align: center;
            color: #222;
            margin-bottom: 24px;
            font-size: 2rem;
        }
        label {
            display: block;
            margin-bottom: 8px;
            color: #555;
            font-size: 1rem;
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            padding: 10px 12px;
            margin-bottom: 18px;
            border: 1px solid #dcdde1;
            border-radius: 6px;
            font-size: 1rem;
            background: #f9f9f9;
            transition: border 0.2s;
        }
        input[type="text"]:focus, input[type="password"]:focus {
            border: 1.5px solid #4f8cff;
            outline: none;
        }
        input[type="email"], input[type="email"] {
            width: 100%;
            padding: 10px 12px;
            margin-bottom: 18px;
            border: 1px solid #dcdde1;
            border-radius: 6px;
            font-size: 1rem;
            background: #f9f9f9;
            transition: border 0.2s;
        }
        input[type="email"]:focus, input[type="email"]:focus {
            border: 1.5px solid #4f8cff;
            outline: none;
        }
        input[type="tel"], input[type="tel"] {
            width: 100%;
            padding: 10px 12px;
            margin-bottom: 18px;
            border: 1px solid #dcdde1;
            border-radius: 6px;
            font-size: 1rem;
            background: #f9f9f9;
            transition: border 0.2s;
        }
        input[type="tel"]:focus, input[type="tel"]:focus {
            border: 1.5px solid #4f8cff;
            outline: none;
        }
        input[type="submit"] {
            width: 100%;
            padding: 10px 0;
            background: #4f8cff;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: background 0.2s;
        }
        input[type="submit"]:hover {
            background: #357ae8;
        }

        input[type="button"] {
            width: 100%;
            padding: 10px 0;
            background: #4f8cff;
            color: #fff;
            border: none;
            border-radius: 6px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: background 0.2s;
        }

        input[type="button"]:hover {
            background: #357ae8;
        }
    </style>

</head>
<body>
<div class="register-container">
    <h1>用户信息修改</h1>
    <form action="UserUpdateServlet?method=update" method="post">

        <label for="userID" style="display: none;">用户ID：</label><%--用户ID--%>
        <input type="text" id="userID" name="userID" readonly="readonly" value="${user.id}" hidden="hidden">

        <label for="userName">用户姓名：</label><%--用户姓名--%>
        <input type="text" id="userName" name="userName" value="${user.username}">

        <label for="userPassword">用户密码</label><%--用户密码--%>
        <input type="password" name="userPassword" id="userPassword" value="${user.userpassword}">

        <label for="nickName">用户昵称</label><%--用户昵称--%>
        <input type="text" name="nickName" id="nickName" value="${user.usernickname}">

        <label for="phone">用户电话</label><%--用户电话--%>
        <input type="tel" name="phone" id="phone" value="${user.userphone}">

        <label for="email">电子邮箱</label><%--用户电子邮箱--%>
        <input type="email" name="email" id="email" value="${user.useremail}">

        <label for="address">地址</label><%--用户地址--%>
        <input type="text" name="address" id="address" value="${user.useraddress}" >

        <input type="submit" value="修改"><%--按下此按钮开始进行添加（转到--待修改）--%>

        <div style="height: 10px"></div><%--分隔符(让上下两个按钮分开)--%>

        <input type="button" value="返回" onclick="window.location.href='/app/UserShowServlet'">
        <%--注册页面点击此按钮返回到供应商列表界面--%>
    </form>
</div>


</body>
</html>